home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT1-5 / RUN.BAT < prev    next >
Encoding:
DOS Batch File  |  1994-08-27  |  3.3 KB  |  138 lines

  1. @Echo Off
  2. Set Work1=
  3. Set Work2=
  4. Set _Path_=%Path%
  5. Path %LnkPath%;%DebPath%;%_Path_%
  6. If %tmp%. == . set tmp=c:\tmp
  7. If %1. == . GoTo Noparm
  8. If %1. == ?. GoTo Help
  9. If %1. == /H. GoTo Help
  10. If %1. == /h. GoTo Help
  11. If %1. == /d. GoTo Debug1
  12. If %1. == /D. GoTo Debug1
  13. If %2. == /d. GoTo DebOth
  14. If %2. == /D. GoTo DebOth
  15. If %3. == /d. GoTo DebOth
  16. If %3. == /D. GoTo DebOth
  17. If %4. == /d. GoTo DebOth
  18. If %4. == /D. GoTo DebOth
  19. GoTo Working
  20. :Debug1
  21. Shift
  22. :DebOth
  23. Echo.
  24. If %comp%. == clip. GoTo EngDebC
  25. If %comp%. == CLIP. GoTo EngDebC
  26. Echo Flag /d was specified - CodeView debugger will be used
  27. GoTo ContDeb1
  28. :EngDebC
  29. Echo Flag /d was specified - Clipper debugger will be attached
  30. :ContDeb1
  31. Set DebMode=Y
  32. GoTo Working
  33. :NoParm
  34. Echo.
  35. Echo No parameters specified - last compiled module will be linked
  36. GoTo Working
  37. :Help
  38. Echo.
  39. Echo %0 - command to object module linking and execution
  40. Echo.
  41. Echo Usage:  %0 object [[executable] map-listing]] [/d]
  42. Echo.
  43. Echo Parameters:
  44. Echo.
  45. Echo object      - object module name (without "OBJ" extension)
  46. Echo               Default : %tmp%\obj.obj
  47. Echo executable  - executable programm name (without "EXE" extension)
  48. Echo               Default : go.exe (if %%TMP%% environment variable was
  49. Echo                       defined - %tmp%\go.exe
  50. Echo map-listing - linker listing file name (without "MAP" extension)
  51. Echo               Default : map.map (if %%TMP%% environment variable was
  52. Echo                         defined - %tmp%\lst.lst
  53. Echo /d          - flag to setting "debugging" LINKER option
  54. Echo.
  55. Echo Example:
  56. Echo.
  57. Echo %0 c:\myprog\kwakwa,c:\myexec\kwakwa
  58. GoTo Exit
  59. :Working
  60. Set Work1=%1
  61. If %Work1%. == . Set Work1=%tmp%\Obj
  62. :NoPrm1
  63. DEL %tmp%\go.* > nul
  64. DEL %tmp%\map.map > nul
  65. Echo.
  66. Echo Linking OBJECT program %Work1%.obj
  67. Echo.
  68. If %DebMode%. == Y. GoTo DebComp
  69. %LnkPath%\%LnkPg% %Work1%,%tmp%\Go,%tmp%\Map.Map,%prlib% %PrmLnk% ;
  70. GoTo EndComp
  71. :DebComp
  72. If %comp%. == clip. GoTo ClipDeb1
  73. If %comp%. == CLIP. GoTo ClipDeb1
  74. %LnkPath%\%LnkPg% %Work1%,%tmp%\Go,%tmp%\Map.Map,%prlib% %PrmLnk% %SetDeb% ;
  75. GoTo EndComp
  76. :ClipDeb1
  77. Set Work1=%Work1%+%ClipDeb%
  78. %LnkPath%\%LnkPg% %Work1%,%tmp%\Go,%tmp%\Map.Map,%prlib% /Noe %PrmLnk% ;
  79. :EndComp
  80. Shift
  81. If %1. == /d. GoTo Deb2
  82. If %1. == /D. GoTo Deb2
  83. GoTo NoDeb2
  84. :Deb2
  85. Shift
  86. :NoDeb2
  87. IF ERRORLEVEL 1 GOTO ERR
  88. Echo.
  89. Echo Use "ESC" key to exit from "BROWSE" command
  90. Echo after end of linkage editing.
  91. Echo.
  92. Echo Linkage editing complete.
  93. Set Work2=.Exe
  94. If Exist %tmp%\Go.Com Set Work2=.Com
  95. IF %1. == . GOTO NoObjCp
  96. IF %1. == .. GOTO NoObjCp
  97. Echo.
  98. Echo Executable programm will be named %1%Work2%
  99. COPY %tmp%\Go.* %1.* > nul
  100. GoTo :NoObjCp
  101. :Err
  102. Echo INVALID OBJECT MODULE - EXECUTABLE PROGRAM NOT CREATED
  103. :NoObjCp
  104. Shift
  105. If %1. == /d. GoTo Deb3
  106. If %1. == /D. GoTo Deb3
  107. GoTo NoDeb3
  108. :Deb3
  109. Shift
  110. :NoDeb3
  111. IF %1. == . GOTO NoLstCp
  112. IF %1 ==  GOTO NoLstCp
  113. Echo Map listing file will be named %1.map
  114. :NOLST
  115. COPY %tmp%\map.map %1.MAP > nul
  116. :NoLstCp
  117. :FINIS
  118. Rem Browse %tmp%\map.map
  119. If Not Exist %tmp%\Go.* GoTo NoExec
  120. Echo.
  121. Echo Results of program's running:
  122. Echo.
  123. If %DebMode%. == Y. GoTo ExeDeb
  124. %tmp%\Go
  125. GoTo Exit
  126. :ExeDeb
  127. If %comp%. == clip. GoTo ClipExe
  128. If %comp%. == CLIP. GoTo ClipExe
  129. %DebPath%\%DebPg% %tmp%\Go%Work2%
  130. GoTo Exit
  131. :ClipExe
  132. %tmp%\Go
  133. :Exit
  134. :NoExec
  135. Set Work1=
  136. Set Work2=
  137. Path %_Path_%
  138. Set _Path_=